﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/AdminMaster.Master" AutoEventWireup="true" CodeBehind="Aritcles.aspx.cs" Inherits="Realisticsoft.Tesdo.Admin.Aritcles" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit.HTMLEditor" TagPrefix="cc1" %>



<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphAdmin" runat="server">
    <div class="content-box-outer">
        <div class="content-box-right">
        </div>
        <div class="content-box-left">
            <h1>Journals Sub Detail<%--<a href="#" class="addNew">Add new category</a>--%></h1>

            <div class="TitleArea"><b>Select Journal: </b></div>
            <div class="textBoxArea">
                <asp:DropDownList ID="ddlJournals" runat="server" Width="300px" DataSourceID="SqlDataSourceJournals" DataTextField="Title" DataValueField="JournalID" OnSelectedIndexChanged="ddlJournals_SelectedIndexChanged" AutoPostBack="True" AppendDataBoundItems="False"></asp:DropDownList>
                <asp:SqlDataSource ID="SqlDataSourceJournals" runat="server" ConnectionString="<%$ ConnectionStrings:connicationStringTesdo %>" SelectCommand="SELECT * FROM [tblJournals] ORDER BY [Title]"></asp:SqlDataSource>
            </div>
            <div class="TitleArea"><b>Select Area: </b></div>
            <div class="textBoxArea">
                <asp:DropDownList ID="ddlCategory" runat="server" Width="300px" DataSourceID="SqlDataSourceCategory" DataTextField="Title" DataValueField="CategoryID"></asp:DropDownList>
                <asp:SqlDataSource ID="SqlDataSourceCategory" runat="server" ConnectionString="<%$ ConnectionStrings:connicationStringTesdo %>" SelectCommand="SELECT * FROM [tblCategories] WHERE ([JournalID] = @JournalID) ORDER BY [Title]">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="ddlJournals" Name="JournalID" PropertyName="SelectedValue" Type="Decimal" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </div>
            <br />
            <div class="TitleArea"><b>Description: </b></div>
            <div>
                <cc1:Editor ID="Editor1" runat="server" Height="500px" />
            </div>
            <div class="TitleArea"><b>.</b></div>
            <div class="textBoxArea">
                <asp:Button Text="Save" runat="server" ID="btnSave" CssClass="buttonDesign" OnClick="btnSave_Click" /><asp:Button Text="Clear" runat="server" ID="btnClear" CssClass="buttonDesign" />
            </div>
            <br clear="all" />
            <h1>Manage Journals Sub Detail<%--<a href="#" class="addNew">Add new category</a>--%></h1>
            <asp:GridView ID="gvJournalSubDetail" runat="server" AutoGenerateColumns="False" CellPadding="4"
                ForeColor="Black" GridLines="Vertical" OnRowCommand="gvJournalSubDetail_RowCommand"
                AllowPaging="True" OnPageIndexChanging="gvJournalSubDetail_PageIndexChanging"
                Width="988px" BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px">
                <RowStyle BackColor="#F7F7DE" />
                <AlternatingRowStyle BackColor="White" />
                <Columns>

                    <asp:TemplateField HeaderText="Journal Title">
                        <ItemTemplate><%# Eval("objJournal.Title") %></ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Category">
                        <ItemTemplate><%# Eval("objCategory.Title") %></ItemTemplate>
                        <ItemStyle Width="200px"></ItemStyle>
                    </asp:TemplateField>

                    <asp:TemplateField HeaderText="Description">
                        <ItemTemplate><%# TrimDescription(Convert.ToString(Eval("Description")),200) %></ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Actions">
                        <ItemTemplate>
                            <asp:ImageButton ID="ImageButtonEdit" Width="15" ToolTip="Edit" CommandArgument='<%#Eval("JournalsSubID") %>'
                                CommandName="cmdUpdate" CausesValidation="False" runat="server" ImageUrl="images/edit.png" />
                            <asp:ImageButton ID="ImageButtonDelete" Width="15" ToolTip="Delete" CommandArgument='<%#Eval("JournalsSubID") %>'
                                CommandName="cmdDelete" OnClientClick="return confirm('Are you sure?');" CausesValidation="False"
                                runat="server" ImageUrl="images/delete.png" />
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" />
                    </asp:TemplateField>
                </Columns>
                <FooterStyle BackColor="#CCCC99" />
                <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
                <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />

                <SortedAscendingCellStyle BackColor="#FBFBF2" />
                <SortedAscendingHeaderStyle BackColor="#848384" />
                <SortedDescendingCellStyle BackColor="#EAEAD3" />
                <SortedDescendingHeaderStyle BackColor="#575357" />

            </asp:GridView>
        </div>
        <div class="MessageArea">
            <asp:Label Text="" ID="lblMsg" runat="server" />
        </div>
    </div>
</asp:Content>
